<?php
/**
*
* @package {PACKAGENAME}
* @version $Id: $
* @copyright (c) 2008 Alejandro Darío Simi
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('__PARAMS_PHP__')) {
define('__PARAMS_PHP__', ' ');

/**
 * @ignore
 */
include '../config.php';

/**
 * TODO
 */
class Params
{
	private static	$vInstance	= null;

	private	$vShowProtected	= false;
	private	$vCharset		= 'UTF-8';
	/**
	 * Constructor.
	 */
	private function __construct()
	{
		$this->vShowProtected	= (isset($_REQUEST['protected']) && $_REQUEST['protected'] == 'on');
		$this->vCharset			= explode(',', $_SERVER['HTTP_ACCEPT_CHARSET']);
		$this->vCharset			= $this->vCharset[0];
	}

	/**
	 * Params show_protected()
	 * returns the singleton instance for Params. If it doesn't exists,
	 * it will be created here.
	 */
	private static function instance()
	{
		if (!Params::$vInstance)
		{
			Params::$vInstance = new Params();
		}
		return Params::$vInstance;
	}

	/**
	 * string show_protected()
	 * @return if the parameter 'protected' is set and it is iqual to 'on', it
	 * returns true, else it returns false;
	 */
	public static function show_protected()
	{
		$inst = Params::instance();
		return $inst->vShowProtected;
	}

	/**
	 * string charset()
	 * @return TODO
	 */
	public static function charset()
	{
		$inst = Params::instance();
		return $inst->vCharset;
	}
};

} // __PARAMS_PHP__ //
?>